QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Cones

Figure 19 shows a cone.

Figure 19 A cone

Labels

ASCII
Cone
Binary
cone ( = 0x636F6E65 )

Data Format

Vector3D            orientation
Vector3D            majorRadius
Vector3D            minorRadius
Point3D             origin
Float32             uMin
Float32             uMax
Float32             vMin
Float32             vMax
orientation
The orientation of the cone. This vector also specifies the height of the cone.
majorRadius
The major radius of the cone.
minorRadius
The minor radius of the cone.
origin
The origin (that is, the center of the base) of the cone.
uMin
Minimum parametric limit value for u. To understand u, first consider u for the ellipse determined by majorRadius and minorRadius . The value of u on this ellipse is parametrized by the angle between the major axis and the vector from the origin to the circumference of the ellipse. The value u = 0 corresponds to 0 radians, and u = 1 corresponds to 2 radians. The values uMin and uMax are used to create partial ellipses. The basic idea is that only the part of the ellipse between uMin and uMax is drawn. For such a particular partial ellipse, the partial cone can be thought of as the result of keeping uMin and uMax fixed but letting v vary through its admissible range. The result looks like a cone with a wedge taken out. For details, see the QD3D documentation or develop magazine, Dec. 96. Must be 0 in Version 1.5.
uMax
Maximum parametric limit value in u direction; see uMin above. Must be 1 in Version 1.5.
vMin
Minimum parametric limit value in v direction. v can be viewed as arc length parametrization of the orientation vector, ranging from 0 at the origin to 1 at the tip. If vMin is not 0, then a truncated cone shaped slice will be removed from the bottom of the cylinder. Must be 0 in Version 1.5.
vMax
Maximum parametric limit value in v direction; see vMin above. If vMax is less than 1, then a small cone will be chopped off the top of the original cone, resulting in a truncated cone. Must be 1 in Version 1.5.

DATA SIZE

0 or 64

Description

A cone is a three-dimensional object defined by an origin (that is, the center of the base) and three vectors that define the orientation and major and minor radii of the cone. A cap may be attached to the base of a cone. Attributes may be assigned to the cap and face of a cone, and also to the entire cone.

DEFAULT SURFACE PARAMETERIZATION

The default surface parameterization for a cone is as shown in Figure 19 .

Parent Hierarchy

Shared, shape, geometry.

Parent Objects

None.

Child Objects

Caps (optional), bottom cap attribute set (optional), face cap attribute set (optional), attribute set (optional). A cone must have a bottom cap in order to have a bottom cap attribute set. Use Caps ( Bottom ) to set a cap on the base of a cone.

Example

Container (
    Cone (
        0 1 0 # orientation
        0 0 1 # major axis
        1 0 0 # minor axis
        0 0 0 # origin
        0     # uMin
        1     # uMax
        0     # vMin
        1     # vMax
    )
    Caps ( Bottom )
    Container (
        BottomCapAttributeSet ( )
        Container (
            AttributeSet ( )
            DiffuseColor ( 1 0 0 )
        )
    )
    Container (
        FaceCapAttributeSet ( )
        Container (
            AttributeSet ( )
            DiffuseColor ( 0 0 1 )
        )
    )
)

See the note in "Cylinders" , for an explanation of cap attribute sets.

Default Size

For objects of size 0, the default is:

1 0 0
0 1 0
0 0 1
0 0 0
0
1
0
1

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |